#include <stdio.h>
#include <ulib.h>
#include <file.h>
#include <unistd.h>

int main(int argc, char** argv) {
	cprintf("Welcome to application restart...\n");

	int resfile;

	int acc = open(argv[1], O_RDONLY);
	if (acc < 0)
	{
		cprintf("Image file not found.\n");
		return 0;
	}

	int pid = restart(0, acc, 0, -1);

	close(acc);

	int exitcode;
	waitpid(pid, &exitcode);

	cprintf("Restat over...\n");

    return 0;
}
